import wans from './model.js';
import { tipmsg } from '../../utils/http.js';
var obj = new wans;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    qid:0,
    title:'',
    content:'',
    ans:0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.data.qid = options.qid;
    this.data.title = options.que;
    this.data.content = options.con;
    this.data.ans = options.ans;
  },

  subans(e){
    let ans = e.detail.value.answer;
    if(ans == ''){
      wx.showToast({
        title: '请给他一个答案吧',
        icon :'none'
      })
      return false;
    }
    //提交
    obj.saveinfo(this,this.data.qid,ans);
  }
})